#ifndef _TIMEANDDATE_H_
#define _TIMEANDDATE_H_

#include <time.h>
#include <string>

namespace util
{

class TimeAndDate
{
public:

	static int				LocalDayFromTimeStamp(time_t TimeStamp);
	static time_t			TimeStampFromLocalDay(int LocalDay);
	
	static int				CurLocalDay();

	static int				WeekGetFirstDay(int LocalDay, bool SundayIsFirst = true);
	static int				WeekGetLastDay(int LocalDay, bool SundayIsFirst = true);

	static int				LocalDayGetYear(int LocalDay); //return real year number, like 2008
	static int				LocalDayGetMonth(int LocalDay);//returns 0-11
	static int				LocalDayGetDayOfMonth(int LocalDay);//returns 1-31
	static int				LocalDayGetDayOfWeek(int LocalDay, bool SundayIsFirst = true);//returns 0-6, with 0 is Sunday if SundayIsFirst == true and 0 is Monday and 6 is Sunday if SundayIsFirst == false

	static void				MakeMondayFirst(int& WeekDay);
	static void				MakeSundayFirst(int& WeekDay); //not of much use as sunday is first by default in <time.h> functions

	static void				BuildDateString(int LocalDay, std::string& ResultDateString, bool MonthIsFirst);
};

} // namespace util
#endif //_TIMEANDDATE_H_